package s.k.gui.webtest.unittest;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;

import com.gargoylesoftware.htmlunit.javascript.host.Element;

import s.k.gui.webtest.Allocator;
import s.k.gui.webtest.BrowserType;
import s.k.gui.webtest.basetools.SKBaseTools;
import s.k.gui.webtest.basetools.SKWindow;
import s.k.gui.webtest.element.Link;
import s.k.gui.webtest.page.Page;

public class IT168Test extends Page {
	/*
	 * public static void main(String[] args) throws InterruptedException {
	 * System.setProperty("webdriver.firefox.bin",
	 * "E:\\Program Files\\Mozilla Firefox\\firefox.exe"); WebDriver driver =
	 * new FirefoxDriver(); driver.get("http://www.it168.com/"); WebElement
	 * LocationPC=driver.findElement(By.linkText("�ʼǱ�")); WebElement anyElement
	 * = driver.findElement(By.linkText("����")); Actions action = new
	 * Actions(driver); action.moveToElement(LocationPC); anyElement.click();
	 * Thread.sleep(5000); driver.quit(); }
	 */
	public IT168Test() {
		super();
		this.comment = "ֻIT测试";
		init();
	}

	public Link PCBook = new Link("手机");
	{
		PCBook.addLinkTextLocator("手机");
	}
	public Link leno = new Link("三星");
	{
		leno.addLinkTextLocator("三星");
	}

	public void ClickLink() {

		PCBook.mouseOver();
		leno.click();

	}

	public void CloseWindow() {

		SKWindow.closeAllWindows();
	}

	public void initPage() {
		SKWindow.openNewWindow(BrowserType.WebDriverFirefox,
				"http://www.it168.com/");
	}

	public static void main(String[] args) throws InterruptedException {

		IT168Test it168 = new IT168Test();
		it168.initPage();
		it168.ClickLink();
		Thread.sleep(10000);
		it168.CloseWindow();
	}

}
